import {get} from "../../utils/db"
Page({
  data: {
    list:[],
    image:[
      "../../static/type/type01.jpg",
      "../../static/type/type02.jpg",
      "../../static/type/type03.jpg",
      "../../static/type/type04.jpg",
      "../../static/type/type05.jpg",
      "../../static/type/type06.jpg",
    ]
  },
  onLoad(){
    this.getTypeList();
  },
  async getTypeList(){
    let res=await get("type").catch(err=>console.error(err));
    this.setData({
      list:res.data
    })
  },
  // 跳转分类列表
  toCateList(e){
    wx.navigateTo({
      url: '/pages/list/list?id='+e.currentTarget.id+'&name='+e.currentTarget.dataset.name,
    })
  },
})